<form name="editForm" role="form" novalidate (ngSubmit)="save()" #editForm="ngForm">

    <div class="modal-header">
        <h4 class="modal-title" id="myTagLabel" jhiTranslate="greatBigExampleApplicationApp.tag.home.createOrEditLabel">Create or edit a Tag</h4>
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true"
                (click)="clear()">&times;</button>
    </div>
    <div class="modal-body">
        <jhi-alert-error></jhi-alert-error>
        <div class="form-group" [hidden]="!tag.id">
            <label for="id" jhiTranslate="global.field.id">ID</label>
            <input type="text" class="form-control" id="id" name="id"
                   [(ngModel)]="tag.id" readonly />
        </div>
        <div class="form-group">
            <label class="form-control-label" jhiTranslate="greatBigExampleApplicationApp.tag.name" for="field_name">Name</label>
            <input type="text" class="form-control" name="name" id="field_name"
                [(ngModel)]="tag.name" required minlength="2" />
            <div [hidden]="!(editForm.controls.name?.dirty && editForm.controls.name?.invalid)">
                <small class="form-text text-danger"
                   [hidden]="!editForm.controls.name?.errors?.required" jhiTranslate="entity.validation.required">
                   This field is required.
                </small>
                <small class="form-text text-danger"
                   [hidden]="!editForm.controls.name?.errors?.minlength" jhiTranslate="entity.validation.minlength" translateValues="{ min: 2 }">
                   This field is required to be at least 2 characters.
                </small>
            </div>
        </div>

    </div>
    <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal" (click)="clear()">
            <span class="fa fa-ban"></span>&nbsp;<span jhiTranslate="entity.action.cancel">Cancel</span>
        </button>
        <button type="submit" [disabled]="editForm.form.invalid || isSaving" class="btn btn-primary">
            <span class="fa fa-save"></span>&nbsp;<span jhiTranslate="entity.action.save">Save</span>
        </button>
    </div>
</form>
